Repository navigation
feat(setup): Add AI-CLI Pup Setup command - #881
Merged
platinummonkey merged 1 commit intoOct 20, 2026
Merged
platinummonkey merged 1 commit into
platinummonkey merged 1 commit into
Conversation
This comment has been minimized.
This comment has been minimized.
tedkahwaji
force-pushed
the
teddy.kahwaji/first-party-extension-autoinstall
branch
4 times, most recently
from
October 13, 2026 17:35
37b16df to
29afbd1
Compare
tedkahwaji
force-pushed
the
teddy.kahwaji/first-party-extension-autoinstall
branch
3 times, most recently
from
October 14, 2026 15:00
c8afc35 to
e60a79a
Compare
tedkahwaji
force-pushed
the
teddy.kahwaji/first-party-extension-autoinstall
branch
from
October 14, 2026 16:42
e60a79a to
67807f1
Compare
tedkahwaji
force-pushed
the
teddy.kahwaji/first-party-extension-autoinstall
branch
4 times, most recently
from
October 20, 2026 13:52
2f7c012 to
472a813
Compare
tedkahwaji
marked this pull request as ready for review
October 20, 2026 14:10
Contributor
There was a problem hiding this comment.
Setup can replace an explicitly configured access token after checking an unrelated saved token’s scopes. Attached and clustered short global flags can also be forwarded to AI Setup instead of being applied by pup.
🤖 Bits Code Review · Commit 472a813
`pup setup` runs Datadog's AI Setup CLI with `npx -y --package @datadog/ai-setup-cli@latest ai-setup-cli`, passing every argument through. AI Setup is already published to npm, so this needs no extension install, release repository or checksums, at the cost of requiring Node.js 22+ when `setup` runs. - Checks for Node.js 22+ and npx, prints how to install what is missing, and sends one best-effort log event (setup_prerequisite_missing, service:setup-cli, 2s timeout) to the Datadog logs intake, the channel AI Setup uses for its own telemetry, so we can measure how often Node is missing. It needs no login, and includes the org UUID (dd_oid) when pup has a session. - Forwards pup's session as DD_ACCESS_TOKEN. When an OAuth session exists, shell API/app keys are dropped, and a lone key is never forwarded. The help lookup uses the same environment. - `--site` passed to setup becomes pup's site for the run, so the site check, the forwarded session and AI Setup's `--site` all agree. - Adds --headless when an AI agent is detected (unless --no-agent) or stdin/stdout isn't a terminal; a person at a terminal gets AI Setup's interactive flow unless they pass --headless. - Headless runs with no session point people without an account to the sign-up page and run pup's OAuth login first. At a terminal, AI Setup's own sign-in runs, and pup offers to log in too after a successful run. - Logins started by pup setup request api_keys_read, which AI Setup needs to write the org's API key into the project. A saved session without it gets one more login; `pup auth login` is unchanged. `auth::login` now returns the session it saved, so setup continues with the right session when the login lands in another region or org. - `pup setup --help` builds a setup command from AI Setup's --help --json and renders it as clap help, so new products and flags show up without a pup release. `pup setup help` and `pup help setup` are aliases. - `pup agent schema setup` says setup passes AI Setup's output through (ending with an AI_SETUP_RESULT line in headless runs) instead of returning an API body. - pup's global flags work after `setup`, and `pup setup --read-only` is blocked, though `pup setup --help` still works in read-only mode. - PUP_SETUP_AI_SETUP_PACKAGE overrides the package spec (version, tag, tarball path or file: spec) to test unreleased AI Setup builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tedkahwaji
force-pushed
the
teddy.kahwaji/first-party-extension-autoinstall
branch
from
October 20, 2026 14:22
472a813 to
b5060c5
Compare
platinummonkey
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
The following change adds
pup setup, which runs Datadog's AI Setup CLI through npx with the user's pup login.We're consolidating AI Setup into pup so users and agents have one Datadog CLI. AI Setup stays its own Node.js package on npm, and
pup setuprunsnpx -y --package @datadog/ai-setup-cli@latest ai-setup-cliwith every argument passed through. That keeps AI Setup releasing on its own schedule and needs no extension install, at the cost of requiring Node.js 22+. The standalonenpx @datadog/ai-setup-clikeeps working.PR Stack
You can find implementation details in the design doc (Datadog internal) and test cases in the test plan (Datadog internal).
Changes
DD_ACCESS_TOKEN. When an AI agent is detected or there's no terminal and there's no login, pup points new users to sign-up and runs its own login first. At a terminal, AI Setup's own sign-in runs, then pup offers to log in too.api_keys_read, which AI Setup needs to write the org's API key into the project.--sitegiven to setup becomes pup's site for the run, so the login, the site check and AI Setup all agree.pup setup --helpshows AI Setup's products and flags in pup's help format.setup, such as--organd--read-only, are handled by pup. Read-only mode blocks setup but allows its help.PUP_SETUP_AI_SETUP_PACKAGEoverrides the npm package, to test unreleased AI Setup builds.